DEFINITION MODULE EtchGlobal;
(*********************************************************)
(*       Some low level routines for EtchAsketch         *)
(*                                                       *)
(*        Written for the Benchmark M2 compiler.         *)
(*                                                       *)
(* Steve Faiwiszewski                     December 1987  *)
(*********************************************************)

FROM Views     IMPORT ViewPortPtr;
FROM Rasters   IMPORT RastPortPtr;
FROM Intuition IMPORT RememberPtr, ScreenPtr;
FROM SYSTEM    IMPORT ADDRESS;

VAR
   MyScreen   : ScreenPtr;
   MyRPort    : RastPortPtr;
   MyVPort    : ViewPortPtr;
   RKey       : RememberPtr;


PROCEDURE Allocate(VAR ptr : ADDRESS; size : LONGCARD);
(* Allocate memory as MemPublic and clear it.      *)
(* Track is kept of the allocation thru the use of *)
(* Intuition's AllocRemember.                      *)

PROCEDURE ChipAllocate(VAR ptr : ADDRESS; size : LONGCARD);
(* Allocate Chip memory as MemPublic and clear it. *)
(* Track is kept of the allocation thru the use of *)
(* Intuition's AllocRemember.                      *)

PROCEDURE AddTerminationProc(t : PROC);
(* Add procedure t to the list of procedures to be *)
(* called upon graceful exit of the program.       *)

PROCEDURE ExitGracefully;
(* Call all the designated terminating procedures, *)
(* and then halt.                                  *)

END EtchGlobal.
